import request from '@/utils/request'

/*
* 房屋
* */
// 房屋管理初始化
export function initRoom(query) {
  return request({
    url: '/gcxt/room/init',
    method: 'get',
    params: query
  })
}

// 查询房屋列表
export function listRoom(query) {
  return request({
    url: '/gcxt/room/page',
    method: 'get',
    params: query
  })
}

// 新增房屋
export function addRoom(data) {
  return request({
    url: '/gcxt/room/add',
    method: 'post',
    data: data
  })
}

// 新增批量房屋
export function addBatchRoom(data) {
  return request({
    url: '/gcxt/room/addBatch',
    method: 'post',
    data: data
  })
}

// 修改房屋
export function updateRoom(data) {
  return request({
    url: '/gcxt/room/edit',
    method: 'post',
    data: data
  })
}

// 删除房屋
export function delRoom(fids = []) {
  return request({
    url: '/gcxt/room/delete',
    method: 'delete',
    data: fids
  })
}

// 查询房屋平面数据
export function planRoom(query) {
  return request({
    url: '/gcxt/room/plan',
    method: 'get',
    params: query
  })
}

// 合并房屋
export function mergeRoom(data) {
  return request({
    url: '/gcxt/room/mergeRoom',
    method: 'post',
    data: data
  })
}

// 拆分房屋
export function splitRoom(data) {
  return request({
    url: '/gcxt/room/splitRoom',
    method: 'post',
    data: data
  })
}

// 删除单元信息
export function deleteUnit(query) {
  return request({
    url: '/gcxt/room/deleteUnit',
    method: 'delete',
    params: query
  })
}
